home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Shareware / Comunicatii / feedaemon / fd110rc5.exe / {app} / Data / defaults / styles / Mega Green.fdxsl < prev    next >
Extensible Markup Language  |  2004-05-30  |  4KB  |  145 lines

  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
  6. <xsl:output method="html"/>
  7.  
  8. <xsl:variable name="common-styles">
  9.     <style type="text/css">
  10.         body {
  11.             font: 140%/140% "Trebuchet MS", Tahoma, sans-serif;
  12.             margin: 20px 30px;
  13.             color: #004A26;
  14.             background-color: #00C665;
  15.             filter: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#C3FFE2,endColorStr=#00C665);
  16.         }
  17.         a { color: #007D01;  }
  18.         a:hover { color: #8A0087; }
  19.         span.nodescription {    font-size: smaller; color: #003C1E; }
  20.         div.newspapertitle {
  21.             font-size: larger;
  22.             text-transform: uppercase;
  23.             font-weight: bold;
  24.             margin-bottom: 16px;
  25.             border-bottom: 3px solid #008A47;
  26.         }
  27.         div.newsitemfooter { font-size: x-small; font-style: italic; }
  28.         div.newsitemtitle {
  29.             font-weight: bold;
  30.         }
  31.         blockquote { font-style: italic;    }
  32.         div.newsitemcontent {
  33.             margin-top: 20px;
  34.         }
  35.         hr.newsitembreak {
  36.             color: #008A47; height: 1px; margin-top: 30px; margin-bottom: 30px;
  37.         }
  38.         div.newsitembreak {
  39.             border-top: 1px dotted #008A47;
  40.             margin: 24px 0;
  41.         }
  42.     </style>
  43. </xsl:variable>
  44.  
  45. <!-- channel group -->
  46. <xsl:template match="newspaper[@type='group']">
  47.     <html>
  48.     <head>
  49.         <title>Group Newspaper</title>
  50.         <xsl:copy-of select="$common-styles"/>
  51.         <style type="text/css">
  52.             div.channelnewsitems {
  53.                 border: 1px solid #008A47;
  54.                 padding: 8px 12px;
  55.                 margin-bottom: 12px;
  56.             }
  57.             div.channeltitle {
  58.                 border: 1px solid #008A47;
  59.                 border-bottom: none;
  60.                 font-weight: bold;
  61.                 text-transform: uppercase;
  62.                 text-align: center;
  63.             }
  64.         </style>
  65.     </head>
  66.     <body>
  67.         <xsl:variable name="newspapertype" select="@type"/>
  68.         <xsl:if test="title">
  69.             <div class="newspapertitle">
  70.                 <xsl:value-of select="title" disable-output-escaping="yes"/>
  71.             </div>
  72.         </xsl:if>
  73.         
  74.         <xsl:for-each select="channel">
  75.             <div class="channeltitle">
  76.                 <xsl:value-of select="title"/>
  77.             </div>
  78.             <div class="channelnewsitems">        
  79.                 <xsl:for-each select="item">
  80.                     <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
  81.                     <xsl:apply-templates select="."/>
  82.                     <div class="newsitembreak"></div>
  83.                 </xsl:for-each>
  84.             </div>
  85.         </xsl:for-each>
  86.     </body>
  87.     </html>    
  88. </xsl:template>
  89.  
  90. <!-- news item and channel -->
  91. <xsl:template match="newspaper[@type='newsitem' or @type='channel']">
  92.     <html>
  93.     <head>
  94.         <title>Newspaper</title>
  95.         <xsl:copy-of select="$common-styles"/>
  96.     </head>
  97.     <body>
  98.         <xsl:variable name="newspapertype" select="@type"/>
  99.         <xsl:if test="title">
  100.             <div class="newspapertitle">
  101.                 <xsl:value-of select="title" disable-output-escaping="yes"/>
  102.             </div>
  103.         </xsl:if>
  104.         
  105.         <xsl:for-each select="channel/item">
  106.             <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
  107.             <xsl:apply-templates select="."/>
  108.             <xsl:if test="$newspapertype != 'newsitem'">
  109.                 <div class="newsitembreak"></div>
  110.             </xsl:if>
  111.         </xsl:for-each>
  112.     </body>
  113.     </html>    
  114. </xsl:template>
  115.  
  116. <!-- news item template -->
  117. <xsl:template match="item">
  118.     <div class="newsitem">
  119.        <div class="newsitemtitle">
  120.             <xsl:variable name="itemlink" select="link"/>
  121.            <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
  122.         </div>            
  123.         <div class="newsitemfooter">
  124.             <xsl:variable name="srclink" select="source/@htmlUrl"/>
  125.             <xsl:value-of select="fd:dateDisplay"/> | <a href="{$srclink}"><xsl:value-of select="source"/></a>
  126.             <!-- add link to comments if available -->
  127.             <xsl:if test="comments">
  128.                 <xsl:variable name="commentlink" select="comments"/>
  129.                 <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
  130.                 | <a href="{$commentlink}"><img src="{$commentimg}" border="0" align="absmiddle" hspace="6"/></a>
  131.             </xsl:if>
  132.             <!-- add link to enclosure if available -->
  133.             <xsl:if test="enclosure">
  134.                 <xsl:variable name="enclosurelink" select="enclosure/@url"/>
  135.                 <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
  136.                 | <a href="{$enclosurelink}"><img src="{$enclosureimg}" align="absmiddle" border="0" hspace="6"/></a>
  137.             </xsl:if>
  138.         </div>
  139.         <div class="newsitemcontent">
  140.             <xsl:value-of select="description" disable-output-escaping="yes"/>
  141.         </div>
  142.     </div>
  143. </xsl:template>
  144.  
  145. </xsl:stylesheet>